<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>hello world</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
    <div id="root"> 
        <!-- <div>{{content}}</div> -->
    </div>

</body>
<script>
   Vue.createApp({
    data(){
        return {
       //  content: 1
           content: 'hello world'
        }
    },

    methods: {
        handleBtnClick(){
            this.content = this.content.split('').reverse().join('');
        }
    },

    mounted(){
        console.log('mounted')
        // setInterval(()=>{
        //     this.content += 1;
        // },1000)
    },
     template: 
     `
     <div>
        {{content}}
        <button  v-on:click="handleBtnClick">反转</button>
    </div>
     `
     //'<div>{{content}}</div>'
   }).mount('#root');
</script>
</html>